<div class="main_box"> 
    <!--左栏开始-->
    
    <div id="mainContent_2"> 
      
      <!-- 评单内容begin --><!-- 评单内容end --> 
      
      <!-- 推荐条目begin -->
      <div id="gift-items">
        <div class="submenubg"></div>
        <div class="bar"></div>
        <div class="box">
          <div class="clear tips bdbottom">
          <p align="right"><a href="<?php echo edp_href_link(PAGENAME_GIFT_SUMMARY); ?>">返回礼品兑换列表&gt;&gt;</a></p>
          <input type="hidden" id="giftId" value="<?php echo $gift['gift_id'];?>">
          
          <div class="iconbg iconbg2"><img src="<?php echo EdpGetGiftCouponPicURL($gift['gift_picture']);?>" width="80" height="81" /></div>
          <div class = "gift_detail">
	          <h5><span id="giftName"><?php echo $gift['gift_name']; ?></span></h5>
		          <p>类型：
<?php
							if($gift['gift_win_rate'] != '1') 
							{
								echo '抽奖';
							}else{
								echo '兑换';
							}
?>			  
	          </p>			  
			  

	<p>有效期：
	          <?php 
	          if(strpos( $gift['gift_type'], '1' )!== false)
			  {
				  echo EdpSubStr($gift['gift_begin_date'],0,10).'至'.EdpSubStr($gift['gift_end_date'],0,10);
			  }
			  else
			  {
				   echo '不限期';
			  }
	          ?>
	          </p>
	          <p> 剩余数目：
	          <?php 
	          if(strpos( $gift['gift_type'], '2' )!== false)
			  {
				  echo $gift['gift_total_num'];
			  }
			  else
			  {
				  echo '不限量';
			  }
	          ?> 
	          </p>
	          <p>价格：<span id="giftPrice"><?php echo $gift['gift_per_price'];?></span>个E币

	           </p>
                  <span id="giftPrompt" style="display: none;"><?php echo $gift['gift_prompt']; ?></span>
                  <a  id="buyGift_<?php echo $gift['gift_id'];?>" class="buyGift" href="#">

                  <img src="<?php
                    if( $gift['gift_win_rate'] == '1' ) 
                        echo IMAGE_DIR.'btn_buygift.gif';
                    else
                        echo IMAGE_DIR.'lottery.gif'; ?>" width="117" height="37" /></a>
	          &nbsp;&nbsp;
			<a href="http://www.huakaili.com/user_setting/?subpage=account_info" target="_blank">更新邮寄地址</a>
			&nbsp;&nbsp;			
			<a href="<?php echo edp_href_link(PAGENAME_HELP, 'subpage=303');?>" target="_blank">查看帮助</a>
			
	       </div>  
           	<div class="clear"></div>	
          </div>
          <div class="clear tips bdbottom">
          	<div class="greybg">
            	<h3>详细信息 </h3><p><?php echo $gift['gift_desc']?></p>
          	</div>
          </div>
          
          <div class="clear tips tips2 bdbottom">
            <h3 class="blak">
<?php 
			if( $gift['gift_win_rate'] == '1' ) 
				echo '兑换记录';
			else
				echo '抽奖记录';
?>

			 </h3>
<?php 
           if($historyForThisGift ) 
           {
           	 	foreach( $historyForThisGift as $thisHistory ) 
           	 	{
?>
		            <p>
		            	<a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$thisHistory['user_id']);?>">
<?php 
						echo $thisHistory['nick'];
?>
		            	</a><span class="grey">
		            	于
<?php 
						echo EdpSubStr($thisHistory['gift_exchange_date'],0,10);
						if( $gift['gift_win_rate'] == '1' ) 
						{
							echo '兑换了';
						}
						else
						{
							echo '尝试抽取';
						}
?>
		            	</span>
		            	<a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$thisHistory['gift_id']);?>">
		            	<?php echo $thisHistory['gift_name'];?>
		            	</a>。
<?php 
						if($thisHistory['note2']=='1')
						{
							echo '<span class="winred">（抽中）</span>';
						}
?>
		            </p>
<?php 
           	 	} 
           }
?>
            
          </div>
          
          <div class="clear tips tips3 ">
          
            <h3 class="blak">热门礼品兑换中…… </h3>
            <div class="clear">
            
<?php 
        if($hotGifts) 
        {
      		foreach( $hotGifts as $hotgift ) 
      		{      	
?>
				<div class="gift2">
					<a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid=' . $hotgift['gift_id']);?>">
						<div class="iconbg"><img src="<?php echo EdpGetGiftCouponPicURL($hotgift['gift_picture']); ?>" width="80" height="81" /></div>
					</a>
					<p class="blue"><a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid=' . $hotgift['gift_id']);?>"><?php echo $hotgift['gift_name']; ?></a></p>
				</div>
<?php 	
      		}
        }
?>
		</div>
            
        <div class="tips3" align="right"><a href="<?php echo edp_href_link(PAGENAME_GIFT_SUMMARY)?>">返回礼品兑换列表>></a>
     </div>
   </div>
        </div>
        <div class="btm"></div>
      </div>
    </div>
    
    <div id="sidebar_right">
<?php
 	LoadSubpage( $page_base, "notice" ); 
 ?>
      
      <div class="column bdbottom2" >
     	 <div class="btna solidbottom"><h4>热门优惠券</h4></div>
     
     <?php 
     if($hotCoupons) 
     {	
      		$i = 1;
      		foreach( $hotCoupons as $coupon ) 
      		{
      ?>
      	<p><a <?php if( $i < 3 ) echo 'class="red"';?>  href="<?php echo edp_href_link(PAGENAME_COUPON_INFO, 'couponID='. $coupon['coupon_id']);?>"><?php echo $coupon['coupon_name'];?></a></p>
      <?php 	
      			$i++;
      		}
      	}
     	?>
      </div>
      
	<div class="column bdbottom2" >
      <div class=" solidbottom">
        <h4>最新兑换</h4></div>
<?php 
		if($giftHistory) 
		{
       		foreach( $giftHistory as $history )
       		{
?>
     			 <p><a href="<?php echo edp_href_link(PAGENAME_USER_INFO, 'uid='.$history['user_id']);?>"><?php echo $history['nick'];?></a>
     			 <span class="blak">
<?php
				  if($history['gift_win_rate']== '1') 
				  {
				  	echo '兑换了';
				  }
				  else
				  {
				  	echo '抽中了';
				  }
?>
     			 </span>
<?php
				if($history['gift_status']==1)
				{
?>
     			 <a href="<?php echo edp_href_link(PAGENAME_GIFT_INFO, 'gid='.$history['gift_id']);?>">
<?php
				} 
?>
     			 <?php echo $history['gift_name'];?>
<?php
				 if($history['gift_status']==1)
				 {
?>
     				 </a>
<?php
				 }
?>
				。<span class="grey"><?php echo $history['timediff'];?>
     			 </span></p>
<?php 
       		}
       	}
     ?>
</div>
</div>

	<div id="PopBox" style="display:none;cursor:default;" class="popup"></div>

        <div id="exchangeGift" style="display:none;cursor:default;" class="popup">
            <div class="popup1">
                <div class="popup_title" style="text-align:left;">
             <?php 
             	if( $gift['gift_win_rate'] == '1' ) 
             		echo '兑换礼品';
             	else
             		echo '抽取礼品';
             ?>
             </div>
                <div tag="close_box" class="popup_close"><a href="###"><span>关闭窗口</span></a></div>
            </div>
            <div class="popup2">
                <div id="messageContet1" style="padding:5px;font-size:12px; font-weight:bold;">
            <?php 
            	if( $gift['gift_win_rate'] == '1' ) 
            		echo '您将兑换礼品';
            	else
            		echo '您将尝试抽取礼品';
            ?>
               <span id="gift_name"></span>，这将消耗您<span style="color: #E50026; font-weight: bold;"><span id="gift_price"></span></span>元E币！<br/>
                  <span id="gift_prompt"></span><br/>
                  <div id="giftNoteBox">
                      <textarea id="giftNote" name="giftNote" cols="30"></textarea>
                  </div>

                </div>
            </div>
            <div class="popup3">
                <div class="popup_btns">
                    <input type="button" class="btn_1" tag="confirm_exchange" value="确定">&nbsp;
                    <input type="button" class="btn_1" tag="confirm_cancel" value="取消">
                </div>
            </div>
        </div>